package cn.source.system.domain;

import cn.source.common.core.domain.BaseEntity;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import org.springframework.data.annotation.Transient;

import java.util.ArrayList;
import java.util.List;

/**
 * @program: source-vue
 * @ClassName: NavCategory
 * @description: 导航分类对象 nav_category
 * @author: 诗涵
 * @create: 2024-02-20 17:00
 */
@Data
public class NavCategory extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 分类 id */
    @JsonSerialize(using = ToStringSerializer.class) //解决id过长，前端格式化，id改变
    private Long id;

    /** 父级id */
    @JsonSerialize(using = ToStringSerializer.class)    //解决id过长，前端格式化，id改变
    private Long parentId;

    /** 排序 */
    private Long sort;

    /** 分类名称 */
    private String name;

    /** 分类图标 */
    private String icon;

    /** 状态（1 正常，2 停用） */
    private Integer status;

    /** 子分类 */
    private List<NavCategory> children = new ArrayList<NavCategory>();
}
